using HardMock.Domain;

namespace HardMock.Recording
{
    internal class StateFullIdentifierFactory : IIdentifierFactory
    {
        private readonly IIdentifierFactory identifierFactory;

        private int counter;

        internal StateFullIdentifierFactory(IIdentifierFactory identifierFactory)
        {
            this.identifierFactory = identifierFactory;
        }

        public StateFullIdentifierFactory()
            : this(new IdentifierFactory())
        {
        }

        public string Create(MethodCall methodCall)
        {
            counter++;
            return string.Format("{0}_{1}", counter, identifierFactory.Create(methodCall));
        }
    }
}